<script setup>
import { articleGetChannelsService } from '@/api/article.js'
import { ref } from 'vue'

const channelList = ref([])
const getChannelList = async () => {
  const result = await articleGetChannelsService()
  channelList.value = result.data.data
}
getChannelList()
defineProps({
  width: {
    type: String,
    default() {
      return '180px'
    }
  },
  modelValue: {
    type: [String, Number]
  }
})
const emit = defineEmits(['update:modelValue'])
</script>

<template>
  <el-select
    :style="{ width: width }"
    :modelValue="modelValue"
    @update:modelValue="emit('update:modelValue', $event)"
  >
    <el-option
      v-for="item in channelList"
      :label="item.cate_name"
      :value="item.id"
      :key="item.id"
    ></el-option>
  </el-select>
</template>

<style scoped></style>
